Charles daEngineer

Piezoelectric Sensor Characterization

The device tested is the DZS Elec 15PCS 35mm Piezo Disc

.

Max Output Voltage Characterization

Max Voltage was tested by placing the piezoelectric sensor on a desk, and hitting the desk with a hammer while observing the output voltage on the oscilloscope. The image is below:

image of an oscilliscope showing max voltage

Output Transfer Characterization

This test is performed using my laptop audio out port. Using python a sinewave is generated, passed to a piezoelectric sensor as a controller where the load piezoelectric sensor is placed on top and the output voltage is measured. The frequency spectrum of the the output signal is recorded on an oscilloscope in decibles. The Code and results are below.

import numpy as np
from scipy.io.wavfile import write

def writeaudio(frequency):
    # Parameters
    samplerate = 44100 # samples per second
    #frequency = 440.0 # sound frequency (Hz)
    duration = 10 # seconds
    filename = "testfreq.wav"
    # Generate the time values and the sine wave data
    t = np.linspace(0., duration, samplerate * duration)
    amplitude = np.iinfo(np.int16).max # Max value for 16-bit PCM
    data = amplitude * np.sin(2. * np.pi * frequency * t)
    # Write the data to a file (convert to 16-bit integer format)
    write(filename, samplerate, data.astype(np.int16))
    return filename

import winsound
from math import log10
minfreq=200
maxfreq=10000
N=20
freq=[0]*N
VdB=[0]*N
freqControl=[0]*N
VdbControl=[0]*N
for i in range(0,N):
    testfreq = int(minfreq*10**(i*log10(maxfreq/minfreq)/(N-1)))
    if testfreq < 250:
        offset= testfreq%1
    elif testfreq < 500:
        offset=testfreq%2
    elif testfreq < 2500:
        offset=testfreq%10
    elif testfreq < 5000:
        offset=testfreq%20
    elif testfreq < 10000:
        offset=testfreq%50
    testfreq = testfreq - (offset)# rounding is helpful for measurements on the oscope
    filename = writeaudio(testfreq)
    input(f"Test frequency is {testfreq} Hz; Enter When Ready")
    winsound.PlaySound(filename,winsound.SND_FILENAME|winsound.SND_LOOP|winsound.SND_ASYNC)
    freqControl[i] = float(input("Measured Control frequency in Hertz: "))
    VdbControl[i] = float(input("Measured Control Volts in dB: ")) #measured as 10^{dB/20}
    freq[i] = float(input("Measured Output frequency in Hertz: "))
    VdB[i] = float(input("Measured Output Volts in dB: ")) #measured as 10^{dB/20}

import csv
data_to_save = [["Control frequency [Hz]","Control Voltage [dB]",\
                 "Output frequency [Hz]","Output Voltage [dB]"]] + \
                 [[freqControl[i],VdbControl[i],freq[i],VdB[i]] for i in range(len(freq))]

filename = "FreqVsVrmsR2.csv"
with open(filename, mode='w', newline='') as file:
    writer = csv.writer(file)
    writer.writerows(data_to_save) # Write all rows at once

import matplotlib.pyplot as plt
# Plot the results
plt.figure(figsize=(10, 5))
plt.plot(freq, VdB)
plt.xlabel("Frequency [Hz]")
plt.ylabel("Amplitude [dB]")
plt.title("Frequency Domain Signal (Amplitude Spectrum)")
plt.grid()
plt.show()
Go back to Discovery Page